<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'questions-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'question'); ?>
		<?php echo $form->textArea($model,'question',array('cols'=>100, 'rows'=>5, 'maxlength'=>300)); ?>
		<?php echo $form->error($model,'question'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'level'); ?>
		<?php echo $form->textField($model,'level',array('size'=>1,'maxlength'=>1)); ?>
		<?php echo $form->error($model,'level'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'tags'); ?>
		<?php echo $form->textField($model,'tags',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'tags'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'answer'); ?>
		<?php 
            echo $form->textArea($model,'answer',array('cols'=>100, 'rows'=>20, 'maxlength'=>2000));
$this->widget('ext.TheCKEditor.TheCKEditorWidget',array(
    'model'=>$model,                # Data-Model (form model)
    'attribute'=>'answer',         # Attribute in the Data-Model
    'height'=>'400px',
    'width'=>'100%',
    'toolbarSet'=>'Basic',          # EXISTING(!) Toolbar (see: ckeditor.js)
    'ckeditor'=>Yii::app()->basePath.'/extensions/ckeditor/CKEditor.php',
                                    # Path to ckeditor.php
    'ckBasePath'=>Yii::app()->baseUrl.'/ckeditor/',
                                    # Relative Path to the Editor (from Web-Root)
    //'css' => Yii::app()->baseUrl.'/css/index.css',
                                    # Additional Parameters
    'config' => array('toolbar'=>array(
         array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
        array( 'Image', 'Link', 'Unlink', 'Anchor' ),
     )),
) );
        ?>
		<?php echo $form->error($model,'answer'); ?>
	</div>
	<div class="row">
		<?php //echo $form->labelEx($model,'submitter'); ?>
		<?php 
            $updateuser = CActiveRecord::model('Users')->find('username=\''.Yii::app()->user->name.'\'')->realname;
            echo $form->textField($model,'submitter',array('hidden'=>true,'size'=>10,'maxlength'=>10, 'value'=>$updateuser)); 
        ?>
         <?php //echo CHTML::activeDropDownList($model,'submitter', CHtml::listData(CActiveRecord::model('Users')->findAll(),'id', 'realname')); ?>
		<?php echo $form->error($model,'submitter'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'updatetime'); ?>
		<?php //echo $form->textField($model,'updatetime'); ?>
		<?php  
            /*
                $this->widget('zii.widgets.jui.CJuiDatePicker', 
                array(
                    'attribute' => 'updatetime',
                    'model'=>$model,
                    'name'=>'updatetime',
                    'options' => array('showAnim' => 'fold','dateFormat' => 'yy-mm-dd')
                ));
            */
        ?>
		<?php //echo $form->error($model,'updatetime'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
